#ifndef VISBASEHASHCONTAINER_H
#define VISBASEHASHCONTAINER_H

#include <QObject>
#include <QMultiHash>
#include <QList>
#include <QDebug>
#include <QString>

#include "visbasecontainer.h"

class VisBaseContainer;

class VisBaseHashContainer : public VisBaseContainer
{
    Q_OBJECT
public:
    explicit VisBaseHashContainer(QPointer<SageVis> sageVisPointer, QPointer<VisBaseWidget> parentWidget, QGraphicsItem *parent = 0);
    
    typedef VisBaseContainer super;

    void addElement(QPointer< VisBaseElement > e, QString hashKey);/*<adds element to the container and connects element 'recomputeLayoutSignal' to 'recomputeLayoutSlot'*/
    void addElement(QPointer< VisBaseElement > e );/*<adds element to the container and connects element 'recomputeLayoutSignal' to 'recomputeLayoutSlot'*/

    void hashElement(QPointer< VisBaseElement > e, QString hashKey);

    QList< QPointer<VisBaseElement> > getElements( QString hashKey );

    void connectElementsWithSameKey( int type ); //connect elements that have the same key together

signals:
    
public slots:

private:
    QMultiHash<QString, QPointer< VisBaseElement > > hashTable;
    
};

#endif // VISBASEHASHCONTAINER_H
